AWS CLI Reference
Configure CLI SSOâ
What you'll needâ
- Install AWS CLI
- Our access portal url: https://d-9067ff8475.awsapps.com/start
Setupâ
- Run
aws configure sso - Enter the following properties:
- Session name: (tip: choose an easy name as you may need to type it in CLI commands)
- SSO start URL: access portal URL from above
- SSO region: us-east-1
- SSO registration scopes: leave default
- After the browser authentication select:
- AWS account
- Role
- Profile name (tip: choose an easy name as you may need to type it in CLI commands)
- Get a list of all configured profiles by running
aws configure list-profiles - Test the configured profile by running
aws s3 ls --profile {profile name}
Additional infoâ
Add user to groupâ
Since we use SSO to manage users in AWS we cannot manage group membership from the AWS console, only from CLI
aws identitystore create-group-membership \
--identity-store-id d-9067ff8475 \
--group-id {group id} \
--member-id UserId={user id}
Remove user from groupâ
aws identitystore delete-group-membership \
--identity-store-id d-9067ff8475 \
--membership-id "$(
aws identitystore get-group-membership-id \
--identity-store-id d-9067ff8475 \
--group-id {group id} \
--member-id UserId={user id} \
--query MembershipId --output text
)"
Open shell in an ECS taskâ
This command allows opening a shell in a running ecs task instance. More info in the doc.
aws ecs execute-command --cluster backend `
--task {task ARN} `
--interactive `
--command "/bin/sh" `
--profile {sso profile name} `
--region {cluster region}